﻿Imports System.ComponentModel
Imports DevExpress.LookAndFeel
Imports System.Linq

Public Class fROrcamentoVendedorGeral
    Dim db As New LinqGeralDataContext

    Sub New()
        InitSkins()
        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Sub InitSkins()
        DevExpress.Skins.SkinManager.EnableFormSkins()
        DevExpress.UserSkins.BonusSkins.Register()
        UserLookAndFeel.Default.SetSkinStyle("Metropolis")
    End Sub


    Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
        GlobalVariables.Empresa = "samecapq"
        If ComboBoxEdit1.Text Is Nothing Or ComboBoxEdit2.Text Is Nothing Then

        Else
            Dim arm As String
            If ComboBoxEdit2.Text = "Geral" Then
                arm = "%"
            Else
                arm = ComboBoxEdit2.Text
            End If
           
            Me.TblROrcamentoVendedorGeralTableAdapter1.Fill(DsManutOrcamento1.tblROrcamentoVendedorGeral, GlobalVariables.Empresa, arm, ComboBoxEdit1.Text)

            Dim Report As New ROrcamentoVendedorGeral

            Report.RequestParameters = False

            Report.DataAdapter = Me.TblROrcamentoVendedorGeralTableAdapter1
            ' Bind the report's printing system to the print control. 
            PrintControl1.PrintingSystem = Report.PrintingSystem


            ' Generate the report's print document. 
            Report.CreateDocument()
        End If
    End Sub

    Private Sub fROrcamentoVendedorGeral_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim a = (From c In db.tblOrcamentos _
                Group c By c.ANO Into Group _
                Select ANO)


        For Each ano In a
            ComboBoxEdit1.Properties.Items.Add(ano.ToString)
        Next

    End Sub
End Class